package com.tang.dict;

import com.alibaba.fastjson.JSONObject;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.HashMap;

/*
* 必填项说明
    1. 普通数据字典
    dictCode, resultField(选填)
    2. 数据表普通数据字典
    dictTable, dictKeyColumn, dictTitleColumn, resultField(选填)
    3. 对象向下解析数据字典

    4. 对象数据字典
    dictTable, dictKeyColumn, resultField(选填), resultType, resultList
    **/
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Dict {
    DictType type() default DictType.dictCode;
    String dictCode() default "";
    String resultField() default "";
    String dictTable() default "";
    String dictKeyColumn() default "id";
    String dictTitleColumn() default "";
    Class resultType() default JSONObject.class;
    boolean resultList() default false;
}
